var e = o(require("../../../../@babel/runtime/regenerator")),
  t = require("../../../../@babel/runtime/helpers/asyncToGenerator"),
  a = o(require("../../../../config/index")),
  r = o(require("../../../../config/page")),
  n = require("../../../../utils/jump"),
  s = require("../../../../services/base/api");
function o(e) {
  return e && e.__esModule ? e : { default: e };
}
Page({
  data: {
    CDN: a.default.CDN,
    COMPLAINT_STATUS: { 1: "待回复", 2: "已处理" },
    objs: [
      "无",
      "其他",
      "服务问题",
      "设施问题",
      "展览问题",
      "环境问题",
      "票务问题",
    ],
    detail: {
      status: 2,
      create_time: "",
      obj: "1",
      content: "",
      phone: "",
      pic: [],
      reply_time: "",
      reply_content: "",
    },
    status: 0,
  },
  onLoad: function (a) {
    var r = this;
    return t(
      e.default.mark(function t() {
        var n, o, i, u, c;
        return e.default.wrap(function (e) {
          for (;;)
            switch ((e.prev = e.next)) {
              case 0:
                if (
                  (r.setData({ status: a.status }),
                  console.log(a),
                  (n = a.id),
                  1 !== Number(a.status))
                ) {
                  e.next = 12;
                  break;
                }
                return (
                  (o = { complaint_id: n }),
                  (e.next = 7),
                  (0, s.postComplaintInfo)(o)
                );
              case 7:
                (i = e.sent),
                  r.setData({ detail: i.data }),
                  console.log(i),
                  (e.next = 18);
                break;
              case 12:
                return (u = { id: n }), (e.next = 15), (0, s.postAdviceInfo)(u);
              case 15:
                (c = e.sent), console.log(c), r.setData({ detail: c.data });
              case 18:
              case "end":
                return e.stop();
            }
        }, t);
      }),
    )();
  },
  toCreateComplaint: function () {
    (0, n.navigateTo)(r.default.PAGE_COMPLAINT_CREATE, {});
  },
});
